<!DOCTYPE html>
<html>

<head>
    <title>Preview Display</title>
    <meta charset="UTF-8">
    <link rel="shortcut icon" href="custom/images/favicon.ico?v=2" />
    <style>
        html,
        body {
            padding: 0px;
            margin: 0px;
        }
        body{
             background:#fff url(assets/智慧兴达/未标题-2.jpg) no-repeat left top;
             background-size:100%;
        }
    </style>

    <script src='custom/configs/htconfig.js'></script>
    <script src='libs/ht.js'></script>

    <script>
        let dataModel = new ht.DataModel();
        //dataModel.a('domain', 'http://' + document.location.host + '/layout_2Deditor');
        dataModel.a('domain', 'http://localhost:7888/layout_2Deditor');

        function init() {
            graphView = new ht.graph.GraphView(dataModel);
            graphView.addToDOM();
            ht.Default.xhrLoad('displays/xd/workshop.json', function (text) {
                var json = ht.Default.parse(text);
                if (json.title) document.title = json.title;
                dataModel.deserialize(json);
                let tag = GetQueryString('tag');
                // dataModel.getDataByTag('四车间')
                let shopData = dataModel.getDataByTag(tag)
                shopData.s('onClick')(event, shopData, graphView);
            });

            //图纸自适应
            graphView.fitContent(true);
        }

        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return decodeURI(r[2]);
            return null;
        }
    </script>
</head>

<body onload='setTimeout(init, 300)'>
</body>

</html>